package com.ruoyi.model.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.model.domain.vo.ModelTaskProcessParamVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.ModelTaskProcessParamMapper;
import com.ruoyi.model.domain.ModelTaskProcessParam;
import com.ruoyi.model.service.IModelTaskProcessParamService;

/**
 * 任务处理参数Service业务层处理
 *
 * @author rww
 * @date 2024-11-25
 */
@Service
public class ModelTaskProcessParamServiceImpl implements IModelTaskProcessParamService
{
    @Autowired
    private ModelTaskProcessParamMapper modelTaskProcessParamMapper;

    /**
     * 查询任务处理参数
     *
     * @param id 任务处理参数主键
     * @return 任务处理参数
     */
    @Override
    public ModelTaskProcessParam selectModelTaskProcessParamById(Long id)
    {
        return modelTaskProcessParamMapper.selectModelTaskProcessParamById(id);
    }

    /**
     * 查询任务处理参数列表
     *
     * @param modelTaskProcessParam 任务处理参数
     * @return 任务处理参数
     */
    @Override
    public List<ModelTaskProcessParamVo> selectModelTaskProcessParamList(ModelTaskProcessParam modelTaskProcessParam)
    {
        return modelTaskProcessParamMapper.selectModelTaskProcessParamList(modelTaskProcessParam);
    }

    /**
     * 新增任务处理参数
     *
     * @param modelTaskProcessParam 任务处理参数
     * @return 结果
     */
    @Override
    public int insertModelTaskProcessParam(ModelTaskProcessParam modelTaskProcessParam)
    {
        modelTaskProcessParam.setId(IdUtil.getSnowflakeNextId());
        modelTaskProcessParam.setCreateTime(DateUtils.getNowDate());
        return modelTaskProcessParamMapper.insertModelTaskProcessParam(modelTaskProcessParam);
    }

    /**
     * 修改任务处理参数
     *
     * @param modelTaskProcessParam 任务处理参数
     * @return 结果
     */
    @Override
    public int updateModelTaskProcessParam(ModelTaskProcessParam modelTaskProcessParam)
    {
        modelTaskProcessParam.setUpdateTime(DateUtils.getNowDate());
        return modelTaskProcessParamMapper.updateModelTaskProcessParam(modelTaskProcessParam);
    }

    /**
     * 批量删除任务处理参数
     *
     * @param ids 需要删除的任务处理参数主键
     * @return 结果
     */
    @Override
    public int deleteModelTaskProcessParamByIds(Long[] ids)
    {
        return modelTaskProcessParamMapper.deleteModelTaskProcessParamByIds(ids);
    }

    /**
     * 删除任务处理参数信息
     *
     * @param id 任务处理参数主键
     * @return 结果
     */
    @Override
    public int deleteModelTaskProcessParamById(Long id)
    {
        return modelTaskProcessParamMapper.deleteModelTaskProcessParamById(id);
    }
}
